package com.ysalliance.getFan.organization.myview;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.LogUtils;
import com.ysalliance.getFan.organization.R;

import androidx.annotation.Nullable;



public class FunButton extends RelativeLayout {
    private ImageView img_src;
    private TextView tv_fun;


    public FunButton(Context context) {
        this(context,null);
    }

    public FunButton(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,-1);
    }

    public FunButton(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
       LayoutInflater.from(getContext()).inflate(R.layout.fun_button,this);
        TypedArray ta=context.obtainStyledAttributes(attrs,R.styleable.fun_button);



        tv_fun=(TextView)findViewById(R.id.tv_fun);
        img_src = (ImageView)findViewById(R.id.img_src);


        tv_fun.setText(ta.getString(R.styleable.fun_button_my_title));
        img_src.setImageResource(ta.getResourceId(R.styleable.fun_button_my_picture,R.mipmap.search));


        ta.recycle();
    }


    public void setTvTag(String fun_button_des){
        tv_fun.setText(fun_button_des);
    }

    public void setFunbt_Img(int dizhi){
        img_src.setImageResource(dizhi);
    }








}
